package com.dungnt.vtime.alarm;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.Toast;

import com.dungnt.model.Alarm;
import com.dungnt.vtime.VTime;

public class AlarmReceiver extends BroadcastReceiver {


	@Override
	public void onReceive(Context context, Intent intent) {
		long alarmId = intent.getLongExtra(Alarm.COL_ID, -1);
		Alarm alarm = new Alarm(alarmId);
		alarm.load(VTime.db);
		Log.d("DungNT", "I catched U!!!");
		alarm.doOnTime(context);
		
		Toast.makeText(context.getApplicationContext(), "Ting Ting Ting", Toast.LENGTH_LONG).show();
		
	}
	
/*	private void doRepeat(Context context, Intent intent) {
	}
*/
}
